package com.nsgf.library.data.bean;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import com.nsgf.library.data.api.APIs;
import com.nsgf.library.utils.StringUtil;

import java.util.List;

public class ProjectBean implements Parcelable {

    private String id;
    private String facilityCode;
    private String areaCode;
    private String facilityType;
    private String facilityName;
    private String pictureUrl;
    private String location;
    private String remark;
    private String createTime;
    private Object createBy;
    private String updateTime;
    private Object updateBy;
    private int status;
    private int sort;
    private String area;
    private boolean statusBl;
    private Object buildType;
    private String responsiblePerson;
    private String coordinates;
    private String contactNumber;
    private Object designDiagram;
    private String videoUrl;
    private String river;
    private String basinWaterSystem;
    private String reservoirType;
    private String functions;
    private String functionsDesc;
    private String functionsReplenish;
    private String projectLevel;
    private String projectScale;
    private String projectScaleDesc;
    private String startTime;
    private String endTime;
    private String guikouMagDepartment;
    private String dataFeedbackDepartment;
    private String materialType;
    private String maxDamHeight;
    private List<WorkOrderDetailBean.FileDto> files;
    private List<?> diagramFiles;
    private List<?> listEquipmentRt;
    private List<ListWtObjRtBean> listWtObjRt;
    private List<VideoFilesBean> videoFiles;
    private List<TempListBean> tempList;
    private String realTimeWaterLevel;
    private String capacity;
    private String hourRainfall;
    private String damTypeDesc;
    private String damCrestHeight;
    private String damCrestHeightDesc;

    public ProjectBean() {
    }

    protected ProjectBean(Parcel in) {
        id = in.readString();
        facilityCode = in.readString();
        areaCode = in.readString();
        facilityType = in.readString();
        facilityName = in.readString();
        pictureUrl = in.readString();
        location = in.readString();
        remark = in.readString();
        createTime = in.readString();
        updateTime = in.readString();
        status = in.readInt();
        sort = in.readInt();
        area = in.readString();
        statusBl = in.readByte() != 0;
        responsiblePerson = in.readString();
        coordinates = in.readString();
        contactNumber = in.readString();
        videoUrl = in.readString();
        river = in.readString();
        basinWaterSystem = in.readString();
        reservoirType = in.readString();
        functions = in.readString();
        functionsDesc = in.readString();
        functionsReplenish = in.readString();
        projectLevel = in.readString();
        projectScale = in.readString();
        projectScaleDesc = in.readString();
        startTime = in.readString();
        endTime = in.readString();
        guikouMagDepartment = in.readString();
        dataFeedbackDepartment = in.readString();
        materialType = in.readString();
        realTimeWaterLevel = in.readString();
        capacity = in.readString();
        hourRainfall = in.readString();
        damTypeDesc = in.readString();
        damCrestHeight = in.readString();
        damCrestHeightDesc = in.readString();
    }

    public static final Creator<ProjectBean> CREATOR = new Creator<ProjectBean>() {
        @Override
        public ProjectBean createFromParcel(Parcel in) {
            return new ProjectBean(in);
        }

        @Override
        public ProjectBean[] newArray(int size) {
            return new ProjectBean[size];
        }
    };

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFacilityCode() {
        return facilityCode;
    }

    public void setFacilityCode(String facilityCode) {
        this.facilityCode = facilityCode;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public String getAreaCodeAndLocation() {
        return (StringUtil.isEmpty(areaCode) ? "--" : areaCode)+getLocation();
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getFacilityType() {
        return facilityType;
    }

    public void setFacilityType(String facilityType) {
        this.facilityType = facilityType;
    }

    public String getFacilityName() {
        return facilityName;
    }

    public void setFacilityName(String facilityName) {
        this.facilityName = facilityName;
    }

    public String getPictureUrl() {
        return pictureUrl;
    }

    public String getPictureUrlSrc() {
        if (StringUtil.isEmpty(pictureUrl)) {
            return "";
        } else return APIs.BASE_URL_IMG + pictureUrl.split(",")[0];
    }

    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }

    public String getLocation() {
        return StringUtil.isEmpty(location) ? "--" : location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getRemark() {
        return StringUtil.isEmpty(remark) ? "--" : remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Object getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Object createBy) {
        this.createBy = createBy;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Object getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Object updateBy) {
        this.updateBy = updateBy;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public boolean isStatusBl() {
        return statusBl;
    }

    public void setStatusBl(boolean statusBl) {
        this.statusBl = statusBl;
    }

    public Object getBuildType() {
        return buildType;
    }

    public void setBuildType(Object buildType) {
        this.buildType = buildType;
    }

    public String getResponsiblePerson() {
        return StringUtil.isEmpty(responsiblePerson) ? "--" : responsiblePerson;
    }

    public void setResponsiblePerson(String responsiblePerson) {
        this.responsiblePerson = responsiblePerson;
    }

    public String getCoordinates() {
        return coordinates;
    }

    public void setCoordinates(String coordinates) {
        this.coordinates = coordinates;
    }

    public String getContactNumber() {
        return StringUtil.isEmpty(contactNumber) ? "--" : contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public Object getDesignDiagram() {
        return designDiagram;
    }

    public void setDesignDiagram(Object designDiagram) {
        this.designDiagram = designDiagram;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public String getRiver() {
        return river;
    }

    public void setRiver(String river) {
        this.river = river;
    }

    public String getBasinWaterSystem() {
        return basinWaterSystem;
    }

    public void setBasinWaterSystem(String basinWaterSystem) {
        this.basinWaterSystem = basinWaterSystem;
    }

    public String getReservoirType() {
        return reservoirType;
    }

    public void setReservoirType(String reservoirType) {
        this.reservoirType = reservoirType;
    }

    public String getFunctions() {
        return functions;
    }

    public void setFunctions(String functions) {
        this.functions = functions;
    }

    public String getFunctionsDesc() {
        return StringUtil.isEmpty(functionsDesc) ? "--" : functionsDesc;
    }

    public String getFunctionsDescSrc() {

        return "主要功能：" + getFunctionsDesc();
    }

    public String kr() {
        String sktxzkr = "";
        if (null == getTempList())
            return "";
        for (TempListBean bean : getTempList()) {
            if ("sktxzkr".equals(bean.getTempId())) {
                sktxzkr = bean.getCharacteristicValue();
            }
        }
        return sktxzkr;
    }


    public void setFunctionsDesc(String functionsDesc) {
        this.functionsDesc = functionsDesc;
    }

    public String getProjectLevel() {
        return projectLevel;
    }

    public void setProjectLevel(String projectLevel) {
        this.projectLevel = projectLevel;
    }

    public String getProjectScale() {
        return StringUtil.isEmpty(projectScale) ? "--" : projectScale;
    }

    public void setProjectScale(String projectScale) {
        this.projectScale = projectScale;
    }

    public String getProjectScaleDesc() {
        return projectScaleDesc;
    }

    public void setProjectScaleDesc(String projectScaleDesc) {
        this.projectScaleDesc = projectScaleDesc;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getGuikouMagDepartment() {
        return StringUtil.isEmpty(guikouMagDepartment) ? "--" : guikouMagDepartment;
    }

    public void setGuikouMagDepartment(String guikouMagDepartment) {
        this.guikouMagDepartment = guikouMagDepartment;
    }

    public String getDataFeedbackDepartment() {
        return StringUtil.isEmpty(dataFeedbackDepartment) ? "--" : dataFeedbackDepartment;
    }

    public void setDataFeedbackDepartment(String dataFeedbackDepartment) {
        this.dataFeedbackDepartment = dataFeedbackDepartment;
    }

    public String getMaterialType() {
        return StringUtil.isEmpty(materialType) ? "--" : materialType;
    }

    public void setMaterialType(String materialType) {
        this.materialType = materialType;
    }

    public String getMaxDamHeight() {
        return StringUtil.isEmpty(maxDamHeight) ? "--" : maxDamHeight;
    }

    public void setMaxDamHeight(String maxDamHeight) {
        this.maxDamHeight = maxDamHeight;
    }

    public List<WorkOrderDetailBean.FileDto> getFiles() {
        return files;
    }

    public void setFiles(List<WorkOrderDetailBean.FileDto> files) {
        this.files = files;
    }

    public List<?> getDiagramFiles() {
        return diagramFiles;
    }

    public void setDiagramFiles(List<?> diagramFiles) {
        this.diagramFiles = diagramFiles;
    }

    public List<?> getListEquipmentRt() {
        return listEquipmentRt;
    }

    public void setListEquipmentRt(List<?> listEquipmentRt) {
        this.listEquipmentRt = listEquipmentRt;
    }

    public List<ListWtObjRtBean> getListWtObjRt() {
        return listWtObjRt;
    }

    public void setListWtObjRt(List<ListWtObjRtBean> listWtObjRt) {
        this.listWtObjRt = listWtObjRt;
    }

    public List<VideoFilesBean> getVideoFiles() {
        return videoFiles;
    }

    public void setVideoFiles(List<VideoFilesBean> videoFiles) {
        this.videoFiles = videoFiles;
    }

    public List<TempListBean> getTempList() {
        return tempList;
    }

    public String getTempList(String value) {
        if (null == getTempList())
            return "";
        for (TempListBean bean : getTempList()) {
            if (value.equals(bean.getTempId())) {
                return bean.getCharacteristicValue();
            }
        }
        return "";
    }

    public String getTempListSrc(int value) {
        switch (value) {
            case 0:
                return getTempList("swtxbzkzlymj");//坝址控制流域面积
            case 1:
                return getTempList("swtxbzddnpjjll");//坝址多年平均年径流量
            case 2:
                return getTempList("swtxsjhsbz");//洪水标准(正常运用)
            case 3:
                return getTempList("swtxsjhsll");//洪峰流量
            case 4:
                return getTempList("swtxsjyrhszl");//设计1日洪水流量
            case 5:
                return getTempList("swtxsjsrhszl");//设计3日洪水流量
            case 6:
                return getTempList("swtxxhhsbz");//校核洪水标准
            case 7:
                return getTempList("swtxxhhsll");//校核洪峰流量
            case 8:
                return getTempList("swtxxhyrhszl");//校核1日洪水流量
            case 9:
                return getTempList("swtxsrhszl");//校核3日洪水流量
            case 10:
                return getTempList("sktxxhhsw");//校核洪水位
            case 11:
                return getTempList("sktxsjhsw");//设计洪水位
            case 12:
                return getTempList("sktxzcxsw");//正常蓄水位(m)
            case 13:
                return getTempList("sktxfhgsw");//防洪高水位(m)
            case 14:
                return getTempList("sktxzkr");//总库容(m)
            case 15:
                return getTempList("sktxfhkr");//防洪库容
            case 16:
                return getTempList("sktxdhkr");//调洪库容
            case 17:
                return getTempList("sktxskr");//死库容
            case 18:
                return getTempList("sktxxhhswszdxxll");//校核洪水位时最大下泄流量(m³/s)
            case 19:
                return getTempList("sktxsjhswszdxxll");//设计洪水位时最大下泄流量(m³/s)
            case 20:
                return getTempList("sktxqxqfhxzsw");//前汛期防洪限制水位(m)
            case 21:
                return getTempList("sktxzxqfhxzsw");//主汛期防洪限制水位(m)
            case 22:
                return getTempList("sktxhxqfhxzsw");//后汛期防洪限制水位(m)
            case 23:
                return getTempList("sktxssw");//死水位
        }
        return "";
    }

    public void setTempList(List<TempListBean> tempList) {
        this.tempList = tempList;
    }

    public String getRealTimeWaterLevel() {
        return StringUtil.isEmpty(realTimeWaterLevel) ? "--" : realTimeWaterLevel;
    }

    public void setRealTimeWaterLevel(String realTimeWaterLevel) {
        this.realTimeWaterLevel = realTimeWaterLevel;
    }

    public String getCapacity() {
        return StringUtil.isEmpty(capacity) ? "--" : capacity;
    }

    public void setCapacity(String capacity) {
        this.capacity = capacity;
    }

    public String getHourRainfall() {
        return StringUtil.isEmpty(hourRainfall) ? "--" : hourRainfall;
    }

    public void setHourRainfall(String hourRainfall) {
        this.hourRainfall = hourRainfall;
    }

    public String getDamTypeDesc() {
        return StringUtil.isEmpty(damTypeDesc) ? "--" : damTypeDesc;
    }

    public void setDamTypeDesc(String damTypeDesc) {
        this.damTypeDesc = damTypeDesc;
    }

    public String getDamCrestHeight() {
        return StringUtil.isEmpty(damCrestHeight) ? "--" : damCrestHeight;
    }

    public void setDamCrestHeight(String damCrestHeight) {
        this.damCrestHeight = damCrestHeight;
    }

    public String getDamCrestHeightDesc() {
        return StringUtil.isEmpty(damCrestHeightDesc) ? "--" : damCrestHeightDesc;
    }

    public void setDamCrestHeightDesc(String damCrestHeightDesc) {
        this.damCrestHeightDesc = damCrestHeightDesc;
    }

    public String getFunctionsReplenish() {
        return StringUtil.isEmpty(functionsReplenish) ? "--" : functionsReplenish;
    }

    public void setFunctionsReplenish(String functionsReplenish) {
        this.functionsReplenish = functionsReplenish;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(facilityCode);
        dest.writeString(areaCode);
        dest.writeString(facilityType);
        dest.writeString(facilityName);
        dest.writeString(pictureUrl);
        dest.writeString(location);
        dest.writeString(remark);
        dest.writeString(createTime);
        dest.writeString(updateTime);
        dest.writeInt(status);
        dest.writeInt(sort);
        dest.writeString(area);
        dest.writeByte((byte) (statusBl ? 1 : 0));
        dest.writeString(responsiblePerson);
        dest.writeString(coordinates);
        dest.writeString(contactNumber);
        dest.writeString(videoUrl);
        dest.writeString(river);
        dest.writeString(basinWaterSystem);
        dest.writeString(reservoirType);
        dest.writeString(functions);
        dest.writeString(functionsDesc);
        dest.writeString(functionsReplenish);
        dest.writeString(projectLevel);
        dest.writeString(projectScale);
        dest.writeString(projectScaleDesc);
        dest.writeString(startTime);
        dest.writeString(endTime);
        dest.writeString(guikouMagDepartment);
        dest.writeString(dataFeedbackDepartment);
        dest.writeString(materialType);
        dest.writeString(realTimeWaterLevel);
        dest.writeString(capacity);
        dest.writeString(hourRainfall);
        dest.writeString(damTypeDesc);
        dest.writeString(damCrestHeight);
        dest.writeString(damCrestHeightDesc);
    }


    public static class ListWtObjRtBean {
        /**
         * type : water.obj.type.3
         * code : 0236598533K
         * name : null
         * projectCode : null
         */

        private String type;
        private String code;
        private Object name;
        private Object projectCode;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public Object getName() {
            return name;
        }

        public void setName(Object name) {
            this.name = name;
        }

        public Object getProjectCode() {
            return projectCode;
        }

        public void setProjectCode(Object projectCode) {
            this.projectCode = projectCode;
        }
    }

    public static class VideoFilesBean {
        /**
         * fileName : null
         * filePath : /facility/III水库.mp4
         * fileSize : 0
         * isDelete : null
         */

        private Object fileName;
        private String filePath;
        private int fileSize;
        private Object isDelete;

        public Object getFileName() {
            return fileName;
        }

        public void setFileName(Object fileName) {
            this.fileName = fileName;
        }

        public String getFilePath() {
            return filePath;
        }

        public void setFilePath(String filePath) {
            this.filePath = filePath;
        }

        public int getFileSize() {
            return fileSize;
        }

        public void setFileSize(int fileSize) {
            this.fileSize = fileSize;
        }

        public Object getIsDelete() {
            return isDelete;
        }

        public void setIsDelete(Object isDelete) {
            this.isDelete = isDelete;
        }
    }

    public static class TempListBean {
        /**
         * id : 1849706207335469057
         * facilityCode : jzsk1833704864169988096
         * characteristicValue : 12.32
         * tempId : sktxdhkr
         * isDelete : 0
         * itemL2Name : null
         * isShow : null
         */

        private String id;
        private String facilityCode;
        private String characteristicValue;
        private String tempId;
        private String isDelete;
        private Object itemL2Name;
        private Object isShow;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getFacilityCode() {
            return facilityCode;
        }

        public void setFacilityCode(String facilityCode) {
            this.facilityCode = facilityCode;
        }

        public String getCharacteristicValue() {
            return StringUtil.isEmpty(characteristicValue) ? "--" : characteristicValue;
        }

        public void setCharacteristicValue(String characteristicValue) {
            this.characteristicValue = characteristicValue;
        }

        public String getTempId() {
            return tempId;
        }

        public void setTempId(String tempId) {
            this.tempId = tempId;
        }

        public String getIsDelete() {
            return isDelete;
        }

        public void setIsDelete(String isDelete) {
            this.isDelete = isDelete;
        }

        public Object getItemL2Name() {
            return itemL2Name;
        }

        public void setItemL2Name(Object itemL2Name) {
            this.itemL2Name = itemL2Name;
        }

        public Object getIsShow() {
            return isShow;
        }

        public void setIsShow(Object isShow) {
            this.isShow = isShow;
        }
    }
}
